package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.Goods;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * ClassName: GoodsDao
 * Description:
 * Date: 2022/1/15 12:35
 *
 * @version:
 * @since JDK 1.8
 */
@Repository
public interface GoodsDao {
    Page<Goods> findPage(@Param("codeOrName") String codeOrName, @Param("goodsTypeId") Integer goodsTypeId);

    String findGoodsType(@Param("goodsTypeId") Integer goodsTypeId);
    Integer findSaleListGoodsTotal(@Param("goodsId") Integer goodsId);


    void deleteGoodsById(@Param("goodsId")Integer goodsId);

    void UpdateGoodsById(@Param("goods")Goods goods);

    void insertGoods(@Param("goods")Goods goods);

    Goods selectGoodsById(@Param("goodsId") Integer goodsId);

    Page<Goods> getNoInventoryQuantity(@Param("codeOrName") String nameOrCode);

    Page<Goods> getHasInventoryQuantity(@Param("codeOrName") String nameOrCode);

    void saveStock(@Param("goodsId") Integer goodsId,@Param("inventoryQuantity") Integer inventoryQuantity,@Param("purchasingPrice") double purchasingPrice);

    List<Goods> getlistAlarm();

    Integer maxGoodCode();

}
